package org.cch.listener;

import java.util.Map;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import org.cch.bean.XMLBean;
import org.cch.util.XMLUtil;

public class ActionListener implements ServletContextListener{

	public void contextDestroyed(ServletContextEvent arg0) {
		System.out.println("信息：系统已经重启！");
		
	}

	public void contextInitialized(ServletContextEvent context) {
		String xmlPath = this.getClass().getResource("/struts.xml").getPath();
		Map<String, XMLBean> map;
		map = XMLUtil.getXMLResult(xmlPath);
		context.getServletContext().setAttribute("xmlMap", map);
		System.out.println("信息：struts.xml加载完成！");
	
		
	}

}
